import * as ol from '../ol'
import 'ol/ol.css';

// 聚合标注，继承自 ol.Overlay
class Marker extends ol.Overlay {
    /**
     * @constructor Marker
     * @description 聚合标注。
     * @param {Object} map - 初始化参数
     * @param {Object} features - 要素点坐标
     */
    constructor(map, features) {
        super({

        });
        this.vectorSource = new ol.source.Vector({
            features: features,
        });
        this.clusterSource = new ol.source.Cluster({
            distance: 40,
            source: this.vectorSource,
        });
        this.vectorLayer = new ol.layer.Vector({
            source: this.clusterSource,
            style: this.clusterStyleFunction,
        });
        map.addLayer(this.vectorLayer);
    }
}
export default Marker